﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// Class Repository. Good example of CRUD operations.
    ///// </summary>
    public class ClassRepository : IClassRepository
    {
        private static readonly IClassDao _class = DataAccess.ClassDao;
        public List<Class> GetList()
        {
            return _class.GetClass().ToList();
        }

        public Class Get(string id)
        {
            return _class.GetClassByID(id);
        }

        public void Insert(Class t)
        {
            _class.InsertClass(t);
        }

        public void Update(Class t)
        {
            _class.UpdateClass(t);
        }

        public void Delete(Class t)
        {
            _class.DeleteClass(t);
        }

        public List<Class> GetClassBySchoolIdAndSchoolYearID(int schoolId, string SchoolYearID)
        {
         return   _class.GetClassBySchoolIdAndSchoolYearID(schoolId, SchoolYearID);
        }


        public List<Class> GetClassPhanLopBySchoolIdAndSchoolYearID(string SchoolYearID, int schoolId)
        {
            return _class.GetClassPhanLopBySchoolIdAndSchoolYearID(SchoolYearID, schoolId);
        }


        public List<Class> GetClassBySchoolIdAndSchoolYearIDNotPhanLop(int schoolId, string SchoolYearID)
        {
            return _class.GetClassBySchoolIdAndSchoolYearIDNotPhanLop(schoolId, SchoolYearID);
        }
    }
}